Quản lý website giới thiệu và bán điện thoại di động ASP.net
19.326 lượt xem;
- doimatkhau.aspx.cs
- project /
1 using System;
2 using System.Collections;
3 using System.Configuration;
4 using System.Data;
5 using System.Linq;
6 using System.Web;
7 using System.Web.Security;
8 using System.Web.UI;
9 using System.Web.UI.HtmlControls;
10 using System.Web.UI.WebControls;
11 using System.Web.UI.WebControls.WebParts;
12 using System.Xml.Linq;
13 using System.Data.OleDb;
14
15 public partial class doimatkhau : System.Web.UI.Page
16 {
17 protected void Page_Load(object sender, EventArgs e)
18 {
19
20 }
21 protected void ChangePasswordPushButton_Click(object sender, EventArgs e)
22 {
23 try
24 {
25 if (txtcu.Text != "")
26 {
27 if (txtmoi.Text!="")
28
29 {
30 if (txtxacnhan.Text != "")
31 {
32 if ((txtmoi.Text == txtxacnhan.Text))
33 {
34 ado.ketNoi();
35 OleDbCommand cmd = new OleDbCommand("select * from tbluser", ado.con);
36 cmd.CommandText = "UPDATE tbluser SET matkhau='" + txtmoi.Text + "' WHERE matkhau='" + txtcu.Text + "'";
37 cmd.ExecuteNonQuery();
38 Response.Redirect("doimatkhauthanhcong.aspx");
39 }
40 else lbltb.Text = "xác nhận mật khẩu chưa đúng";
41 }
42 else lbltb.Text = "Bạn chưa xác nhận mật khẩu";
43 }
44 else lbltb.Text = "Bạn chưa nhập mật khẩu cũ";
45 }
46 else lbltb.Text = "Bạn chưa nhập mật khẩu mới";
47
48 }
49 catch (Exception ex)
50 { Response.Write(ex); }
51
52
53 }
54 protected void CancelPushButton_Click(object sender, EventArgs e)
55 {
56 Response.Redirect("thongtintaikhoan.aspx");
57 }
58 }
2 using System.Collections;
3 using System.Configuration;
4 using System.Data;
5 using System.Linq;
6 using System.Web;
7 using System.Web.Security;
8 using System.Web.UI;
9 using System.Web.UI.HtmlControls;
10 using System.Web.UI.WebControls;
11 using System.Web.UI.WebControls.WebParts;
12 using System.Xml.Linq;
13 using System.Data.OleDb;
14
15 public partial class doimatkhau : System.Web.UI.Page
16 {
17 protected void Page_Load(object sender, EventArgs e)
18 {
19
20 }
21 protected void ChangePasswordPushButton_Click(object sender, EventArgs e)
22 {
23 try
24 {
25 if (txtcu.Text != "")
26 {
27 if (txtmoi.Text!="")
28
29 {
30 if (txtxacnhan.Text != "")
31 {
32 if ((txtmoi.Text == txtxacnhan.Text))
33 {
34 ado.ketNoi();
35 OleDbCommand cmd = new OleDbCommand("select * from tbluser", ado.con);
36 cmd.CommandText = "UPDATE tbluser SET matkhau='" + txtmoi.Text + "' WHERE matkhau='" + txtcu.Text + "'";
37 cmd.ExecuteNonQuery();
38 Response.Redirect("doimatkhauthanhcong.aspx");
39 }
40 else lbltb.Text = "xác nhận mật khẩu chưa đúng";
41 }
42 else lbltb.Text = "Bạn chưa xác nhận mật khẩu";
43 }
44 else lbltb.Text = "Bạn chưa nhập mật khẩu cũ";
45 }
46 else lbltb.Text = "Bạn chưa nhập mật khẩu mới";
47
48 }
49 catch (Exception ex)
50 { Response.Write(ex); }
51
52
53 }
54 protected void CancelPushButton_Click(object sender, EventArgs e)
55 {
56 Response.Redirect("thongtintaikhoan.aspx");
57 }
58 }